find_package(GMP)
if(GMP_FOUND)
  add_definitions(-DDAI_WITH_BP -DDAI_WITH_FBP -DDAI_WITH_TRWBP -DDAI_WITH_MF -DDAI_WITH_HAK)
  add_definitions(-DDAI_WITH_LC -DDAI_WITH_TREEEP -DDAI_WITH_JTREE -DDAI_WITH_MR -DDAI_WITH_GIBBS)
  add_definitions(-DDAI_WITH_CBP -DDAI_WITH_DECMAP)
  file(GLOB Sources libdai/src/*.cpp)
  include_directories("libdai/include")
  include_directories(${GMP_INCLUDE_DIRS})
  app(bp-dai bp-dai.cpp ${Sources} EXTLIBS ${GMP_LIBRARIES} ${GMPXX_LIBRARIES} REQUIRES GMP_FOUND TBB_FOUND)
  app(bp bp.cpp)
endif()